package Sun

import sun.security.provider.Sun

import org.apache.commons.pool2.impl.GenericObjectPoolConfig
import redis.clients.jedis.JedisPool
/**
 * Created by Sun on 2016/6/17.
 */
object RedisClient extends Serializable   {

  //符合新的
  val redisHost = "10.100.100.105"
  val redisPort = 9001
  val redisTimeout = 3000
  lazy val pool = new JedisPool(new GenericObjectPoolConfig(), redisHost, redisPort, redisTimeout)

  lazy val hook = new Thread {
    override def run = {
      println("Execute hook thread: " + this)
      pool.destroy()
    }
  }

  sys.addShutdownHook(hook.run)
}
